<template>
  <div class="m-leadsInfo-lead">
    <div class="m-dataList">
      <el-table
        :data="dataList"
        style="width: 100%"
        v-loading="dataListLoading"
        element-loading-text="loading..."
        ref="dataList"
        max-height="700"
      >
        <el-table-column
          prop="account"
          width="120"
          label="客户账号">
          <template slot-scope="scope">
            <router-link :to="{name:'AccountDetailsInfo',params:{id:scope.row.id+'_'+scope.row.account}}">
              {{scope.row.account}}
            </router-link>
          </template>
        </el-table-column>
        <el-table-column
          prop="realName"
          label="姓名"
          width="120">
        </el-table-column>
        <el-table-column
          prop="paperNo"
          label="证件号码"
          min-width="120">
        </el-table-column>
        <el-table-column
          prop="phone"
          label="手机号码"
          width="120">
        </el-table-column>
        <el-table-column
          prop="otherPhone"
          label="其他手机号码"
          width="120">
        </el-table-column>
        <el-table-column
          prop="email"
          label="电邮"
          width="200">
        </el-table-column>
        <el-table-column
          prop="groupName"
          label="客户组"
          width="120">
        </el-table-column>
        <el-table-column
          prop="openTimeStr"
          label="开户时间"
          width="160">
        </el-table-column>
      </el-table>
    </div>
    <!--<div class="m-pagination">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :page-sizes=pagination.pageSizeList
        :current-page=pagination.pageNo
        :page-size=pagination.pageSize
        layout="total, sizes, prev, pager, next"
        :total=pagination.total>
      </el-pagination>
    </div>-->
  </div>
</template>

<script>
  import * as Utils from '@/utils'
import * as RealaccountAPI from '@/Api/realaccount'
  export default {
    name: 'TheAccountDetailsAccount',
    data () {
      return {
        dataList: [],
//        pagination: Utils.commonPagination(),
        dataListLoading:false,
      }
    },
    methods: {
      queryList(){
        this.dataListLoading = true;
        if (this.$refs.dataList) {
          this.$refs.dataList.bodyWrapper.scrollTop = 0;
        }
        RealaccountAPI.realaccountInfo14({
          id: this.$route.params.id.split("_")[0],
        })
          .then(res => {
            this.dataListLoading = false;
            if (res.code != 0) {
              this.$notify({
                title: '温馨提示',
                message: res.msg,
                type: 'warning'
              })
              return;
            }
            this.dataList = res.data;
//            this.pagination.total = res.data.total;
          })
          .catch(error => {
            this.dataListLoading = false;
            console.log(error)
          })
      },
     /* handleSizeChange(size) {
        this.pagination.pageSize = size;
        if (this.pagination.pageNo == 1) {
          this.queryList();
        } else {
          this.pagination.pageNo = 1;
        }
      },
      handleCurrentChange(index) {
        this.pagination.pageNo = index;
        this.queryList();

      },*/
    },
    created(){
      this.queryList();
    },
  }
</script>

<style scoped lang="scss">
  .m-leadsInfo-lead {
    padding-top: 24px;
  }
</style>
